#include "cmsis_os2.h"
#include "utils.h"

#define TRIPOD_HCAN     (&hcan2)
#define TRIPOD_BOARD_ID 1
#define TRIPOD_MOTOR_ID 1

typedef struct
{
    double deltaX;
    double depth;
} BoxType;

typedef enum
{
    AUTO = 1,
    MANUAL,
    UPARROW,
} TripodMode;

// typedef struct{
//     int boradId;
//     int motorId;
//     int manualMaxSpeed;
//     int leftLimit;
//     int rightLimit;

// }tripodType;

void boxReaderFunc(void *argument);
void tripodHeadFunc(void *argument);
void aimingModuleInit();
void changeManul();
void changeAuto();
extern BoxType boxes[30];
extern int aimingId;
extern int autoAimingMode;
extern int running;
extern PID_s aimingPid;

extern int manualLeft;
extern int manualRight;

void manualLeftStart();
void manualLeftStop();
void manualRightStart();
void manualRightStop();
int manualArrive();

extern osSemaphoreId_t TripodTokenSema;
